const express = require('express');
const router = express.Router();
const data = [];
for(let i = 1; i < 51; i++)
    data.push({
        id: `${i}`,
        code: `QH2019082700-${i}`,
        dealerCode: '10145',
        dealerName: '总代名称10145',
        status: 1,
        claimAmount: 9865,
        approvalAmount: 9865,
        submitDate: '2019-09-04T02:37:44.918Z'
    });
router.get('/forCurrentUser', (req, res) => {
    const {pageIndex, pageSize} = req.query;
    res.json({
        message: 'ok',
        payload: {
            content: data,
            pageIndex: parseInt(pageIndex, 10),
            pageSize: parseInt(pageSize, 10),
            totalElements: 50
        }
    });
});

router.get('/:id', (req, res) => {
    res.json({
        message: 'ok',
        payload: {
            id: '1',
            code: 'QH2019082700-1',
            dealerCode: '10145',
            dealerName: '总代名称10145',
            status: 1,
            claimAmount: 9865,
            approvalAmount: 9865,
            submitDate: '2019-09-04T02:37:44.918Z',
            receiveDate: '2019-09-04T02:37:44.918Z',
            buyerAddress: 'buyerAddress',
            buyerTelephone: 'buyerTelephone',
            buyerFax: 'buyerFax',
            buyerContact: 'buyerContact',
            details: [
                {
                    id: '1',
                    partCode: 'partCode1',
                    partName: 'partName1',
                    partEngName: 'partEngName1',
                    damagedQty: 3,
                    price: 4,
                    fobAmount: 6,
                    claimAmount: 7,
                    approvalAmount: 1,
                    claimInvNo: 'claimInvNo'
                }
            ],
            processDetails: [
                {
                    id: '1',
                    processer: 'processer',
                    processStatus: 1,
                    processComment: 'processComment',
                    processDate: '2019-09-04T02:37:44.918Z',
                }
            ]
        }
    });
});
module.exports = router;
